package cn.com.haopy.yue.ai.db.entity.arisk;

import cn.com.haopy.yue.ai.db.entity.BaseEntity;
import cn.com.haopy.yue.ai.db.mybatis.JsonObjectsTypeHandler;
import cn.com.haopy.yue.ai.db.mybatis.JsonStringArrayTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.util.Map;

/**
 * @Description: TODO
 * @Author DuTao
 * @Date 2025/3/26 9:05
 */
@Data
@TableName(value = "arisk_papers", autoResultMap = true)
@ApiModel(value = "问卷")
public class AIRiskPapers extends BaseEntity {
    @TableField(value = "user_id")
    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @TableField(value = "name")
    @ApiModelProperty(value = "姓名")
    private String name;

    @TableField(value = "mobile")
    @ApiModelProperty(value = "手机号")
    private String mobile;


    @TableField(value = "check_no")
    @ApiModelProperty(value = "体检号")
    private String checkNo;

    @TableField(value = "check_date")
    @ApiModelProperty(value = "体检日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate checkDate;


    @TableField(value = "age")
    @ApiModelProperty(value = "年龄")
    private Integer age;

    @TableField(value = "sex")
    @ApiModelProperty(value = "男")
    private String sex;

    @TableField(value = "index_params", jdbcType = JdbcType.BLOB, typeHandler = JsonObjectsTypeHandler.class)
    @ApiModelProperty(value = "指标json")
    private Map<String, Object> indexParams;

    @TableField(value = "is_submit", jdbcType = JdbcType.BIT)
    @ApiModelProperty(value = "是否提交问卷")
    private Boolean isSubmit;

    @TableField(value = "pdf_url", jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "评估报告pdf地址")
    private String pdfUrl;

    @TableField(value = "input_params", jdbcType = JdbcType.BLOB, typeHandler = JsonObjectsTypeHandler.class)
    @ApiModelProperty(value = "总结文本输入参数")
    private Map<String, Object> inputParams;

    @TableField(value = "result_content", jdbcType = JdbcType.BLOB)
    @ApiModelProperty(value = "评估报告文本结论")
    private String resultContent;

    @TableField(value = "sports_suggest",  typeHandler = JsonStringArrayTypeHandler.class)
    @ApiModelProperty(value = "运动建议")
    private String[] sportsSuggest;

    @TableField(value = "check_suggest", jdbcType = JdbcType.BLOB, typeHandler = JsonStringArrayTypeHandler.class)
    @ApiModelProperty(value = "检查建议")
    private String[] checkSuggest;

    @TableField(value = "life_suggest", jdbcType = JdbcType.BLOB, typeHandler = JsonStringArrayTypeHandler.class)
    @ApiModelProperty(value = "生活建议")
    private String[] lifeSuggest;

    @TableField(value = "foods_suggest", jdbcType = JdbcType.BLOB, typeHandler = JsonStringArrayTypeHandler.class)
    @ApiModelProperty(value = "饮食建议")
    private String[] foodsSuggest;


}
